home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2001 May / may_2001.iso / intercd / root / Multimedia / ^DivX_Article / virtualdub / VirtualDub-source-1_4d / mpeg_tables.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-03-20  |  13.4 KB  |  415 lines

  1. //    VirtualDub - Video processing and capture application
  2. //    Copyright (C) 1998-2001 Avery Lee
  3. //
  4. //    This program is free software; you can redistribute it and/or modify
  5. //    it under the terms of the GNU General Public License as published by
  6. //    the Free Software Foundation; either version 2 of the License, or
  7. //    (at your option) any later version.
  8. //
  9. //    This program is distributed in the hope that it will be useful,
  10. //    but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. //    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. //    GNU General Public License for more details.
  13. //
  14. //    You should have received a copy of the GNU General Public License
  15. //    along with this program; if not, write to the Free Software
  16. //    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  17.  
  18. ///////////////////////////////////////////////////////////////////////////
  19. //
  20. //                                 WARNING
  21. //
  22. // This code is heavily based off of the Java MPEG video player written by
  23. // Joerg Anders.  Because his code was released under the GNU GPL v2, this
  24. // means VirtualDub must also be released under GNU GPL v2 when MPEG
  25. // support is included.
  26. //
  27. // (Like that's any different.)
  28. //
  29. // This code is really nasty...
  30. //
  31. ///////////////////////////////////////////////////////////////////////////
  32.  
  33. #include "mpeg_tables.h"
  34.  
  35. const char mpeg_macro_block_inc_decode[96*2]={
  36. 0,8,    0,8,    0,8,    0,8,    0,8,    0,8,    0,8,    0,8,
  37. -2,11,    0,11,    0,10,    0,10,    0,10,    0,10,    0,11,    -1,11,
  38. 0,8,    0,8,    0,8,    0,8,    0,8,    0,8,    0,8,    0,8,
  39. 33,11,    32,11,    31,11,    30,11,    29,11,    28,11,    27,11,    26,11,
  40. 25,11,    24,11,    23,11,    22,11,    21,10,    21,10,    20,10,    20,10,
  41. 19,10,    19,10,    18,10,    18,10,    17,10,    17,10,    16,10,    16,10,
  42. 15,8,    15,8,    15,8,    15,8,    15,8,    15,8,    15,8,    15,8,
  43. 14,8,    14,8,    14,8,    14,8,    14,8,    14,8,    14,8,    14,8,
  44. 13,8,    13,8,    13,8,    13,8,    13,8,    13,8,    13,8,    13,8,
  45. 12,8,    12,8,    12,8,    12,8,    12,8,    12,8,    12,8,    12,8,
  46. 11,8,    11,8,    11,8,    11,8,    11,8,    11,8,    11,8,    11,8,
  47. 10,8,    10,8,    10,8,    10,8,    10,8,    10,8,    10,8,    10,8,
  48. };
  49.  
  50. const char mpeg_macro_block_inc_decode2[58*2]={
  51.                                                 9,7,    8,7,
  52. 7,5,    7,5,    7,5,    7,5,    6,5,    6,5,    6,5,    6,5,
  53. 5,4,    5,4,    5,4,    5,4,    5,4,    5,4,    5,4,    5,4,
  54. 4,4,    4,4,    4,4,    4,4,    4,4,    4,4,    4,4,    4,4,
  55. 3,3,    3,3,    3,3,    3,3,    3,3,    3,3,    3,3,    3,3,
  56. 3,3,    3,3,    3,3,    3,3,    3,3,    3,3,    3,3,    3,3,
  57. 2,3,    2,3,    2,3,    2,3,    2,3,    2,3,    2,3,    2,3,
  58. 2,3,    2,3,    2,3,    2,3,    2,3,    2,3,    2,3,    2,3,
  59. };
  60.  
  61. const unsigned char mpeg_block_pattern_decode1[128*2]={
  62. 0,8,    0,8,    39,9,    27,9,    59,9,    55,9,    47,9,    31,9,
  63. 58,8,    58,8,    54,8,    54,8,    46,8,    46,8,    30,8,    30,8,
  64. 57,8,    57,8,    53,8,    53,8,    45,8,    45,8,    29,8,    29,8,
  65. 38,8,    38,8,    26,8,    26,8,    37,8,    37,8,    25,8,    25,8,
  66. 43,8,    43,8,    23,8,    23,8,    51,8,    51,8,    15,8,    15,8,
  67. 42,8,    42,8,    22,8,    22,8,    50,8,    50,8,    14,8,    14,8,
  68. 41,8,    41,8,    21,8,    21,8,    49,8,    49,8,    13,8,    13,8,
  69. 35,8,    35,8,    19,8,    19,8,    11,8,    11,8,    7,8,    7,8,
  70. 34,7,    34,7,    34,7,    34,7,    18,7,    18,7,    18,7,    18,7,
  71. 10,7,    10,7,    10,7,    10,7,    6,7,    6,7,    6,7,    6,7,
  72. 33,7,    33,7,    33,7,    33,7,    17,7,    17,7,    17,7,    17,7,
  73. 9,7,    9,7,    9,7,    9,7,    5,7,    5,7,    5,7,    5,7,
  74. 63,6,    63,6,    63,6,    63,6,    63,6,    63,6,    63,6,    63,6,
  75. 3,6,    3,6,    3,6,    3,6,    3,6,    3,6,    3,6,    3,6,
  76. 36,6,    36,6,    36,6,    36,6,    36,6,    36,6,    36,6,    36,6,
  77. 24,6,    24,6,    24,6,    24,6,    24,6,    24,6,    24,6,    24,6,
  78. };
  79.  
  80. const unsigned char mpeg_block_pattern_decode0[24*2]={
  81. 62,5,    2,5,    61,5,    1,5,    56,5,    52,5,    44,5,    28,5,
  82. 40,5,    20,5,    48,5,    12,5,    32,4,    32,4,    16,4,    16,4,
  83. 8,4,    8,4,    4,4,    4,4,    60,3,    60,3,    60,3,    60,3,
  84. };
  85.  
  86. const unsigned char mpeg_dct_size_luminance_decode[64*2]={
  87. 0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,
  88. 0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,    0,    3,
  89. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  90. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  91. 4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,
  92. 4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,    4,    3,
  93. 5,    4,    5,    4,    5,    4,    5,    4,    5,    4,    5,    4,    5,    4,    5,    4,
  94. 6,    5,    6,    5,    6,    5,    6,    5,    7,    6,    7,    6,    8,    7,    0,    7,
  95. };
  96.  
  97. const unsigned char mpeg_dct_size_chrominance_decode[64*2]={
  98. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  99. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  100. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  101. 3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,    3,
  102. 4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  103. 4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,    4,
  104. 5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,    5,
  105. 6,    6,    6,    6,    6,    6,    6,    6,    7,    7,    7,    7,    8,    8,    0,    8,
  106. };
  107.  
  108. const unsigned char mpeg_dct_coeff_decode2[512*4]={
  109. 0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,
  110. 0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,    0,0,5+1,0,
  111. 1,18,9+1,0,    1,17,9+1,0,    1,16,9+1,0,    1,15,9+1,0,    6,3,9+1,0,    16,2,9+1,0,    15,2,9+1,0,    14,2,9+1,0,
  112. 13,2,9+1,0,    12,2,9+1,0,    11,2,9+1,0,    31,1,9+1,0,    30,1,9+1,0,    29,1,9+1,0,    28,1,9+1,0,    27,1,9+1,0,
  113. 0,40,8+1,0,    0,40,8+1,0,    0,39,8+1,0,    0,39,8+1,0,    0,38,8+1,0,    0,38,8+1,0,    0,37,8+1,0,    0,37,8+1,0,
  114. 0,36,8+1,0,    0,36,8+1,0,    0,35,8+1,0,    0,35,8+1,0,    0,34,8+1,0,    0,34,8+1,0,    0,33,8+1,0,    0,33,8+1,0,
  115. 0,32,8+1,0,    0,32,8+1,0,    1,14,8+1,0,    1,14,8+1,0,    1,13,8+1,0,    1,13,8+1,0,    1,12,8+1,0,    1,12,8+1,0,
  116. 1,11,8+1,0,    1,11,8+1,0,    1,10,8+1,0,    1,10,8+1,0,    1,9,8+1,0,    1,9,8+1,0,    1,8,8+1,0,    1,8,8+1,0,
  117. 0,31,7+1,0,    0,31,7+1,0,    0,31,7+1,0,    0,31,7+1,0,    0,30,7+1,0,    0,30,7+1,0,    0,30,7+1,0,    0,30,7+1,0,
  118. 0,29,7+1,0,    0,29,7+1,0,    0,29,7+1,0,    0,29,7+1,0,    0,28,7+1,0,    0,28,7+1,0,    0,28,7+1,0,    0,28,7+1,0,
  119. 0,27,7+1,0,    0,27,7+1,0,    0,27,7+1,0,    0,27,7+1,0,    0,26,7+1,0,    0,26,7+1,0,    0,26,7+1,0,    0,26,7+1,0,
  120. 0,25,7+1,0,    0,25,7+1,0,    0,25,7+1,0,    0,25,7+1,0,    0,24,7+1,0,    0,24,7+1,0,    0,24,7+1,0,    0,24,7+1,0,
  121. 0,23,7+1,0,    0,23,7+1,0,    0,23,7+1,0,    0,23,7+1,0,    0,22,7+1,0,    0,22,7+1,0,    0,22,7+1,0,    0,22,7+1,0,
  122. 0,21,7+1,0,    0,21,7+1,0,    0,21,7+1,0,    0,21,7+1,0,    0,20,7+1,0,    0,20,7+1,0,    0,20,7+1,0,    0,20,7+1,0,
  123. 0,19,7+1,0,    0,19,7+1,0,    0,19,7+1,0,    0,19,7+1,0,    0,18,7+1,0,    0,18,7+1,0,    0,18,7+1,0,    0,18,7+1,0,
  124. 0,17,7+1,0,    0,17,7+1,0,    0,17,7+1,0,    0,17,7+1,0,    0,16,7+1,0,    0,16,7+1,0,    0,16,7+1,0,    0,16,7+1,0,
  125. 10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,    10,2,6+1,0,
  126. 9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,    9,2,6+1,0,
  127. 5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,    5,3,6+1,0,
  128. 3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,    3,4,6+1,0,
  129. 2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,    2,5,6+1,0,
  130. 1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,    1,7,6+1,0,
  131. 1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,    1,6,6+1,0,
  132. 0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,    0,15,6+1,0,
  133. 0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,    0,14,6+1,0,
  134. 0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,    0,13,6+1,0,
  135. 0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,    0,12,6+1,0,
  136. 26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,    26,1,6+1,0,
  137. 25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,    25,1,6+1,0,
  138. 24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,    24,1,6+1,0,
  139. 23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,    23,1,6+1,0,
  140. 22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,    22,1,6+1,0,
  141. 0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,
  142. 0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,    0,11,5+1,0,
  143. 8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,
  144. 8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,    8,2,5+1,0,
  145. 4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,
  146. 4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,    4,3,5+1,0,
  147. 0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,
  148. 0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,    0,10,5+1,0,
  149. 2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,
  150. 2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,    2,4,5+1,0,
  151. 7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,
  152. 7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,    7,2,5+1,0,
  153. 21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,
  154. 21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,    21,1,5+1,0,
  155. 20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,
  156. 20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,    20,1,5+1,0,
  157. 0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,
  158. 0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,    0,9,5+1,0,
  159. 19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,
  160. 19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,    19,1,5+1,0,
  161. 18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,
  162. 18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,    18,1,5+1,0,
  163. 1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,
  164. 1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,    1,5,5+1,0,
  165. 3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,
  166. 3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,    3,3,5+1,0,
  167. 0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,
  168. 0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,    0,8,5+1,0,
  169. 6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,
  170. 6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,    6,2,5+1,0,
  171. 17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,
  172. 17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,    17,1,5+1,0,
  173. };
  174.  
  175. const unsigned char mpeg_dct_coeff_decode1[8*2]={
  176. 16,1,
  177. 5,2,
  178. 0,7,
  179. 2,3,
  180. 1,4,
  181. 15,1,
  182. 14,1,
  183. 4,2,
  184. };
  185.  
  186. const unsigned char mpeg_dct_coeff_decode0[88*4]={
  187.  3,2,8,0x10,     3,2,8,0x10,    10,1,8,0x10,    10,1,8,0x10,
  188.  1,4,8,0x10,     1,4,8,0x10,     9,1,8,0x10,     9,1,8,0x10,
  189.  
  190.  8,1,7,0x20,     8,1,7,0x20,     8,1,7,0x20,     8,1,7,0x20,
  191.  7,1,7,0x20,     7,1,7,0x20,     7,1,7,0x20,     7,1,7,0x20,
  192.  2,2,7,0x20,     2,2,7,0x20,     2,2,7,0x20,     2,2,7,0x20,
  193.  6,1,7,0x20,     6,1,7,0x20,     6,1,7,0x20,     6,1,7,0x20,
  194.  
  195. 14,1,9,0x08,     1,6,9,0x08,    13,1,9,0x08,    12,1,9,0x08,
  196.  4,2,9,0x08,     2,3,9,0x08,     1,5,9,0x08,    11,1,9,0x08,
  197.  
  198.  1,3,6,0x40,     1,3,6,0x40,     1,3,6,0x40,     1,3,6,0x40,
  199.  1,3,6,0x40,     1,3,6,0x40,     1,3,6,0x40,     1,3,6,0x40,
  200.  5,1,6,0x40,     5,1,6,0x40,     5,1,6,0x40,     5,1,6,0x40,
  201.  5,1,6,0x40,     5,1,6,0x40,     5,1,6,0x40,     5,1,6,0x40,
  202.  4,1,6,0x40,     4,1,6,0x40,     4,1,6,0x40,     4,1,6,0x40,
  203.  4,1,6,0x40,     4,1,6,0x40,     4,1,6,0x40,     4,1,6,0x40,
  204.  
  205.  1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,
  206.  1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,
  207.  1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,
  208.  1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,     1,2,5,0x80,
  209.  3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,
  210.  3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,
  211.  3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,
  212.  3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,     3,1,5,0x80,
  213. };
  214.  
  215. const unsigned char mpeg_p_type_mb_type_decode[32*2]={
  216.     0x00,    6,
  217.     0x11,    6,
  218.     0x12,    5,
  219.     0x12,    5,
  220.     0x1a,    5,
  221.     0x1a,    5,
  222.     0x01,    5,
  223.     0x01,    5,
  224.     0x08,    3,
  225.     0x08,    3,
  226.     0x08,    3,
  227.     0x08,    3,
  228.     0x08,    3,
  229.     0x08,    3,
  230.     0x08,    3,
  231.     0x08,    3,
  232.     0x02,    2,
  233.     0x02,    2,
  234.     0x02,    2,
  235.     0x02,    2,
  236.     0x02,    2,
  237.     0x02,    2,
  238.     0x02,    2,
  239.     0x02,    2,
  240.     0x02,    2,
  241.     0x02,    2,
  242.     0x02,    2,
  243.     0x02,    2,
  244.     0x02,    2,
  245.     0x02,    2,
  246.     0x02,    2,
  247.     0x02,    2,
  248. };
  249.  
  250. const unsigned char mpeg_b_type_mb_type_decode[32*2]={
  251.     0,        6,
  252.     17,        6,
  253.     22,        6,
  254.     26,        6,
  255.     30,        5,
  256.     30,        5,
  257.     1,        5,
  258.     1,        5,
  259.     8,        4,
  260.     8,        4,
  261.     8,        4,
  262.     8,        4,
  263.     10,        4,
  264.     10,        4,
  265.     10,        4,
  266.     10,        4,
  267.     4,        3,
  268.     4,        3,
  269.     4,        3,
  270.     4,        3,
  271.     4,        3,
  272.     4,        3,
  273.     4,        3,
  274.     4,        3,
  275.     6,        3,
  276.     6,        3,
  277.     6,        3,
  278.     6,        3,
  279.     6,        3,
  280.     6,        3,
  281.     6,        3,
  282.     6,        3,
  283. };
  284.  
  285. const char mpeg_motion_code_decode[96*2]={
  286. 0,    7,
  287. 0,    7,
  288. 0,    7,
  289. 0,    7,
  290. 0,    7,
  291. 0,    7,
  292. 0,    7,
  293. 0,    7,
  294. 0,    7,
  295. 0,    7,
  296. 0,    7,
  297. 0,    7,
  298. 0,    7,
  299. 0,    7,
  300. 0,    7,
  301. 0,    7,
  302. 0,    8,
  303. 0,    8,
  304. 0,    8,
  305. 0,    8,
  306. 0,    8,
  307. 0,    8,
  308. 0,    8,
  309. 0,    8,
  310. 16,    11,
  311. -16,    11,
  312. 15,    11,
  313. -15,    11,
  314. 14,    11,
  315. -14,    11,
  316. 13,    11,
  317. -13,    11,
  318. 12,    11,
  319. -12,    11,
  320. 11,    11,
  321. -11,    11,
  322. 10,    10,
  323. 10,    10,
  324. -10,    10,
  325. -10,    10,
  326. 9,    10,
  327. 9,    10,
  328. -9,    10,
  329. -9,    10,
  330. 8,    10,
  331. 8,    10,
  332. -8,    10,
  333. -8,    10,
  334. 7,    8,
  335. 7,    8,
  336. 7,    8,
  337. 7,    8,
  338. 7,    8,
  339. 7,    8,
  340. 7,    8,
  341. 7,    8,
  342. -7,    8,
  343. -7,    8,
  344. -7,    8,
  345. -7,    8,
  346. -7,    8,
  347. -7,    8,
  348. -7,    8,
  349. -7,    8,
  350. 6,    8,
  351. 6,    8,
  352. 6,    8,
  353. 6,    8,
  354. 6,    8,
  355. 6,    8,
  356. 6,    8,
  357. 6,    8,
  358. -6,    8,
  359. -6,    8,
  360. -6,    8,
  361. -6,    8,
  362. -6,    8,
  363. -6,    8,
  364. -6,    8,
  365. -6,    8,
  366. 5,    8,
  367. 5,    8,
  368. 5,    8,
  369. 5,    8,
  370. 5,    8,
  371. 5,    8,
  372. 5,    8,
  373. 5,    8,
  374. -5,    8,
  375. -5,    8,
  376. -5,    8,
  377. -5,    8,
  378. -5,    8,
  379. -5,    8,
  380. -5,    8,
  381. -5,    8,
  382. };
  383.  
  384. const char mpeg_motion_code_decode2[58*2]={
  385. 4,    7,    -4,    7,
  386. 3,    5,    3,    5,
  387. 3,    5,    3,    5,
  388. -3,    5,    -3,    5,
  389. -3,    5,    -3,    5,
  390. 2,    4,    2,    4,
  391. 2,    4,    2,    4,
  392. 2,    4,    2,    4,
  393. 2,    4,    2,    4,
  394. -2,    4,    -2,    4,
  395. -2,    4,    -2,    4,
  396. -2,    4,    -2,    4,
  397. -2,    4,    -2,    4,
  398. 1,    3,    1,    3,
  399. 1,    3,    1,    3,
  400. 1,    3,    1,    3,
  401. 1,    3,    1,    3,
  402. 1,    3,    1,    3,
  403. 1,    3,    1,    3,
  404. 1,    3,    1,    3,
  405. 1,    3,    1,    3,
  406. -1,    3,    -1,    3,
  407. -1,    3,    -1,    3,
  408. -1,    3,    -1,    3,
  409. -1,    3,    -1,    3,
  410. -1,    3,    -1,    3,
  411. -1,    3,    -1,    3,
  412. -1,    3,    -1,    3,
  413. -1,    3,    -1,    3,
  414. };
  415.